package net.northcoding.fresh.parser;

import net.northcoding.fresh.ast.AstNode;
import net.northcoding.fresh.ast.Expression;
import net.northcoding.fresh.ast.ProgramNode;
import net.northcoding.fresh.token.Token;

import java.util.Vector;

public class Parser {
    public static AstNode parser(Vector<Token> tokens) {
        ProgramNode root = new ProgramNode();
        AstNode result = Expression.parse(tokens);
        if (result != null) {
            root.addChild(result);
        }
        return root;
    }
}